import operator
from itertools import accumulate

n = int(input())
max_n = (1<<n.bit_length())-1
fac = [1]*(max_n+1)
for i in range(2, max_n+1):
    for j in range(i,max_n+1,i):
        fac[j] += 1
nums = list(map(int, input().split()))
prefix = [0] + list(accumulate(nums,operator.xor))
ans = 0
for i in range(n+1):
    for j in range(i):
        val = prefix[i] ^ prefix[j]
        if not fac[val] & 1: ans += 1
print(ans)